package com.taotao.job.core.util;

import org.slf4j.helpers.MessageFormatter;

/**
 * @author fanbeibei
 * @version 1.0
 * @date 2020/10/16 14:46
 */
public class MessageFormatUtil {

    private MessageFormatUtil() {
    }


    /**
     * <p>
     * For example,
     *
     * <pre>
     *   MessageFormatUtil.format(&quot;Hi {}.&quot;, &quot;there&quot;)
     *   </pre>
     * <p>
     * will return the string "Hi there.".
     *
     * @param messagePattern
     * @param args
     * @return
     */
    public static String format(String messagePattern, Object... args) {
        return MessageFormatter.arrayFormat(messagePattern, args).getMessage();
    }


    public static void main(String[] args) {
        System.out.println(format(" {} &&&&& {} ", 342423, 464645));
    }


}
